using UnityEngine;

namespace Crosstales.OnlineCheck
{
    // [Assembly-CSharp-firstpass.dll].Crosstales.OnlineCheck.OnlineCheck
    public class OnlineCheck : Singleton<Crosstales.OnlineCheck.OnlineCheck>
    {
        
        #region Crosstales.OnlineCheck.OnlineCheck.OnlineStatusChange
        // [Assembly-CSharp-firstpass.dll].Crosstales.OnlineCheck.OnlineCheck.OnlineStatusChange
        public sealed class OnlineStatusChange : MulticastDelegate
        {
            // Methods
            public OnlineStatusChange(object object, IntPtr method)
            {
                var val_1;
                mem[1152921504930430416] = method;
                mem[1152921504930430440] = method;
                mem[1152921504930430432] = object;
                mem[1152921504930430464] = this;
                if((method & 1) == 0)
                {
                    goto label_0;
                }
                
                if(((method + 83) & 16) != 0)
                {
                    goto label_1;
                }
                
                if((method + 82) != 1)
                {
                    goto label_2;
                }
                
                val_1 = 4303108;
                goto label_7;
                label_0:
                if(object == null)
                {
                        throw 0;
                }
                
                label_2:
                mem[1152921504930430424] = ???;
                mem[1152921504930430464] = ???;
                goto label_5;
                label_1:
                if((method + 82) == 1)
                {
                        val_1 = 4303124;
                }
                else
                {
                        val_1 = 4303184;
                }
                
                label_7:
                mem[1152921504930430424] = val_1;
                label_5:
                mem[1152921504930430456] = 4303036;
            }
            public virtual void Invoke(bool isConnected)
            {
                bool val_1 = isConnected;
                goto x3;
            }
            public virtual System.IAsyncResult BeginInvoke(bool isConnected, System.AsyncCallback callback, object object)
            {
                bool val_1 = isConnected;
                return (System.IAsyncResult)this;
            }
            public virtual void EndInvoke(System.IAsyncResult result)
            {
            
            }
        
        }
        
        #endregion
        
        
        #region Crosstales.OnlineCheck.OnlineCheck.NetworkReachabilityChange
        // [Assembly-CSharp-firstpass.dll].Crosstales.OnlineCheck.OnlineCheck.NetworkReachabilityChange
        public sealed class NetworkReachabilityChange : MulticastDelegate
        {
            // Methods
            public NetworkReachabilityChange(object object, IntPtr method)
            {
                var val_1;
                mem[1152921504930430416] = method;
                mem[1152921504930430440] = method;
                mem[1152921504930430432] = object;
                mem[1152921504930430464] = this;
                if((method & 1) == 0)
                {
                    goto label_0;
                }
                
                if(((method + 83) & 16) != 0)
                {
                    goto label_1;
                }
                
                if((method + 82) != 1)
                {
                    goto label_2;
                }
                
                val_1 = 4303340;
                goto label_7;
                label_0:
                if(object == null)
                {
                        throw 0;
                }
                
                label_2:
                mem[1152921504930430424] = ???;
                mem[1152921504930430464] = ???;
                goto label_5;
                label_1:
                if((method + 82) == 1)
                {
                        val_1 = 4303356;
                }
                else
                {
                        val_1 = 4303412;
                }
                
                label_7:
                mem[1152921504930430424] = val_1;
                label_5:
                mem[1152921504930430456] = 4303268;
            }
            public virtual void Invoke(UnityEngine.NetworkReachability networkReachability)
            {
                goto x3;
            }
            public virtual System.IAsyncResult BeginInvoke(UnityEngine.NetworkReachability networkReachability, System.AsyncCallback callback, object object)
            {
                return (System.IAsyncResult)this;
            }
            public virtual void EndInvoke(System.IAsyncResult result)
            {
            
            }
        
        }
        
        #endregion
        
        
        #region Crosstales.OnlineCheck.OnlineCheck.OnlineCheckComplete
        // [Assembly-CSharp-firstpass.dll].Crosstales.OnlineCheck.OnlineCheck.OnlineCheckComplete
        public sealed class OnlineCheckComplete : MulticastDelegate
        {
            // Methods
            public OnlineCheckComplete(object object, IntPtr method)
            {
                var val_1;
                mem[1152921504930430416] = method;
                mem[1152921504930430440] = method;
                mem[1152921504930430432] = object;
                mem[1152921504930430464] = this;
                if((method & 1) == 0)
                {
                    goto label_0;
                }
                
                if(((method + 83) & 16) != 0)
                {
                    goto label_1;
                }
                
                if((method + 82) != 2)
                {
                    goto label_2;
                }
                
                val_1 = 4303580;
                goto label_7;
                label_0:
                if(object == null)
                {
                        throw 0;
                }
                
                label_2:
                mem[1152921504930430424] = ???;
                mem[1152921504930430464] = ???;
                goto label_5;
                label_1:
                if((method + 82) == 2)
                {
                        val_1 = 4303600;
                }
                else
                {
                        val_1 = 4303676;
                }
                
                label_7:
                mem[1152921504930430424] = val_1;
                label_5:
                mem[1152921504930430456] = 4303492;
            }
            public virtual void Invoke(bool isConnected, UnityEngine.NetworkReachability networkReachability)
            {
                bool val_1 = isConnected;
                goto x4;
            }
            public virtual System.IAsyncResult BeginInvoke(bool isConnected, UnityEngine.NetworkReachability networkReachability, System.AsyncCallback callback, object object)
            {
                bool val_1 = isConnected;
                return (System.IAsyncResult)this;
            }
            public virtual void EndInvoke(System.IAsyncResult result)
            {
            
            }
        
        }
        
        #endregion
        
        
        #region Crosstales.OnlineCheck.OnlineCheck.<RefreshYield>d__137
        // [Assembly-CSharp-firstpass.dll].Crosstales.OnlineCheck.OnlineCheck.<RefreshYield>d__137
        private sealed class _RefreshYield_d__137 : IEnumerator<object>, IEnumerator, IDisposable
        {
            // Fields
            private int __1__state;
            private object __2__current;
            public Crosstales.OnlineCheck.OnlineCheck __4__this;
            public bool triggerCallbacks;
            
            // Properties
            private object System.Collections.Generic.IEnumerator<System.Object>.Current { get; }
            private object System.Collections.IEnumerator.Current { get; }
            
            // Methods
            public _RefreshYield_d__137(int __1__state)
            {
                this.__1__state = __1__state;
            }
            private void System.IDisposable.Dispose()
            {
            
            }
            private bool MoveNext()
            {
                var val_6;
                if((this.__1__state - 1) >= 2)
                {
                    goto label_1;
                }
                
                val_6 = 0;
                goto label_10;
                label_1:
                if(this.__1__state != 0)
                {
                        return true;
                }
                
                this.__1__state = 0;
                if((this.__4__this == 0) || ((this.__4__this.isActiveAndEnabled == false) || (this.__4__this.isRunning == true)))
                {
                    goto label_9;
                }
                
                float val_4 = UnityEngine.Time.realtimeSinceStartup;
                float val_6 = 1f;
                val_6 = this.__4__this.lastCheckTime + val_6;
                if(val_6 >= 0)
                {
                    goto label_9;
                }
                
                bool val_7 = this.__4__this.isFirsttime;
                val_7 = this.triggerCallbacks | val_7;
                this.__4__this.isFirsttime = val_7;
                this.__2__current = this.__4__this.internetCheck();
                val_6 = 1;
                goto label_10;
                label_9:
                this.__2__current = 0;
                val_6 = 2;
                label_10:
                this.__1__state = 2;
                return true;
            }
            private object System.Collections.Generic.IEnumerator<System.Object>.get_Current()
            {
                return (object)this.__2__current;
            }
            private void System.Collections.IEnumerator.Reset()
            {
                27351792 = new System.NotSupportedException();
                throw 27351792;
            }
            private object System.Collections.IEnumerator.get_Current()
            {
                return (object)this.__2__current;
            }
        
        }
        
        #endregion
        
        
        #region Crosstales.OnlineCheck.OnlineCheck.<wwwCheck>d__139
        // [Assembly-CSharp-firstpass.dll].Crosstales.OnlineCheck.OnlineCheck.<wwwCheck>d__139
        private sealed class _wwwCheck_d__139 : IEnumerator<object>, IEnumerator, IDisposable
        {
            // Fields
            private int __1__state;
            private object __2__current;
            public Crosstales.OnlineCheck.OnlineCheck __4__this;
            public string url;
            public bool equals;
            public string data;
            public int header;
            public bool showError;
            public string type;
            private UnityEngine.Networking.UnityWebRequest _www_5__2;
            private float _startTime_5__3;
            
            // Properties
            private object System.Collections.Generic.IEnumerator<System.Object>.Current { get; }
            private object System.Collections.IEnumerator.Current { get; }
            
            // Methods
            public _wwwCheck_d__139(int __1__state)
            {
                this.__1__state = __1__state;
            }
            private void System.IDisposable.Dispose()
            {
                if(this.__1__state != 1)
                {
                        if(this.__1__state != 3)
                {
                        return;
                }
                
                }
                
                this.<>m__Finally1();
            }
            private bool MoveNext()
            {
                UnityEngine.Networking.DownloadHandlerBuffer val_22;
                UnityEngine.Networking.UnityWebRequest val_23;
                Crosstales.OnlineCheck.OnlineCheck val_24;
                UnityEngine.Networking.UnityWebRequest val_25;
                var val_26;
                var val_27;
                string val_28;
                bool val_30;
                Crosstales.OnlineCheck.OnlineCheck.Crosstales_OnlineCheck_OnlineCheck__wwwCheck_d__139 val_31;
                val_22 = this;
                val_23 = 27498088;
                val_24 = this.__4__this;
                if(this.__1__state != 1)
                {
                        if(this.__1__state != 0)
                {
                        return false;
                }
                
                    this.__1__state = 0;
                    if(val_24 == null)
                {
                        throw new NullReferenceException();
                }
                
                    this.__4__this.available = false;
                    val_25 = UnityEngine.Networking.UnityWebRequest.Get(uri:  Crosstales.OnlineCheck.OnlineCheck.URLAntiCacheRandomizer(url:  this.url));
                    mem[1152921504930430480] = val_25;
                    this.__1__state = 2;
                    val_23 = mem[1152921504930430480];
                    mem[1152921504930430488] = UnityEngine.Time.realtimeSinceStartup;
                    if(val_23 == 0)
                {
                        throw new NullReferenceException();
                }
                
                    val_25 = this.__4__this.timeout;
                    val_23.timeout = val_25;
                    val_24 = mem[1152921504930430480];
                    val_23 = 536885261;
                    val_22 = val_23;
                    if(val_23 == 0)
                {
                        throw new NullReferenceException();
                }
                
                    val_23 = val_22;
                    val_25 = 0;
                    val_23 = new UnityEngine.Networking.DownloadHandlerBuffer();
                    if(val_24 == 0)
                {
                        throw new NullReferenceException();
                }
                
                    val_25 = val_22;
                    val_24.downloadHandler = val_25;
                    val_23 = mem[1152921504930430480];
                    if(val_23 == 0)
                {
                        throw new NullReferenceException();
                }
                
                    mem[1152921504930430424] = val_23.SendWebRequest();
                    this.__1__state = 1;
                    return false;
                }
                
                val_23 = this._www_5__2;
                this.__1__state = 2;
                if(val_23 == null)
                {
                        throw new NullReferenceException();
                }
                
                val_25 = 0;
                if(val_23.result == 3)
                {
                    goto label_10;
                }
                
                val_23 = mem[1152921504930430480];
                if(val_23 == 0)
                {
                        throw new NullReferenceException();
                }
                
                val_25 = 0;
                if(val_23.result != 2)
                {
                    goto label_12;
                }
                
                label_10:
                val_26 = 536882899;
                if(mem[536883123] == 0)
                {
                        val_26 = 536882899;
                }
                
                val_23 = this;
                var val_19 = mem[536883083] + 72;
                val_19 = mem[1152921504930430468] | val_19;
                if(val_19 == false)
                {
                    goto label_17;
                }
                
                if(mem[1152921504930430480] == 0)
                {
                        throw new NullReferenceException();
                }
                
                val_22 = -1610607793(-1610607793) + mem[1152921504930430472] + -1610610373(-1610610373) + mem[1152921504930430480].error;
                UnityEngine.Debug.LogError(message:  val_22, context:  val_24);
                goto label_17;
                label_12:
                val_23 = mem[1152921504930430480];
                if(val_23 == 0)
                {
                        throw new NullReferenceException();
                }
                
                val_25 = 0;
                UnityEngine.Networking.DownloadHandler val_9 = val_23.downloadHandler;
                if(val_9 == null)
                {
                        throw new NullReferenceException();
                }
                
                string val_10 = val_9.text;
                val_27 = 536882899;
                if(mem[536883123] == 0)
                {
                        val_27 = 536882899;
                }
                
                if((mem[536883083] + 72) != 0)
                {
                        UnityEngine.Debug.Log(message:  -1610608639(-1610608639) + val_10, context:  val_24);
                }
                
                val_28 = 27346392;
                if(mem[1152921504930430448] == false)
                {
                    goto label_23;
                }
                
                val_25 = 0;
                if((System.String.IsNullOrEmpty(value:  val_10)) == false)
                {
                    goto label_24;
                }
                
                val_30 = 0;
                if(val_24 != null)
                {
                    goto label_31;
                }
                
                throw new NullReferenceException();
                label_23:
                val_25 = 0;
                if((System.String.IsNullOrEmpty(value:  val_10)) == false)
                {
                    goto label_27;
                }
                
                val_30 = 0;
                if(val_24 != null)
                {
                    goto label_31;
                }
                
                label_24:
                val_28 = mem[1152921504930430456];
                val_25 = val_28;
                val_30 = Crosstales.ExtensionMethods.CTEquals(str:  val_10, toCheck:  val_25, comp:  5);
                if(val_24 != null)
                {
                    goto label_31;
                }
                
                throw new NullReferenceException();
                label_27:
                val_25 = mem[1152921504930430456];
                val_30 = Crosstales.ExtensionMethods.CTContains(str:  val_10, toCheck:  val_25, comp:  5);
                label_31:
                this.__4__this.available = val_30;
                if(val_30 != false)
                {
                        float val_16 = UnityEngine.Time.realtimeSinceStartup;
                    val_31 = this;
                    val_16 = val_16 - mem[1152921504930430488];
                    val_16 = val_16 * 1000f;
                    this.__4__this._LastCheckRTTMilliseconds_k__BackingField = (val_16 == Infinityf) ? -2147483648 : ((int)val_16);
                }
                else
                {
                        val_31 = this;
                }
                
                val_23 = mem[1152921504930430480];
                if(val_23 == 0)
                {
                        throw new NullReferenceException();
                }
                
                val_22 = this.__4__this._DataDownloaded_k__BackingField;
                long val_20 = val_23.downloadedBytes;
                val_20 = val_20 + val_22;
                val_20 = val_20 + mem[1152921504930430464];
                this.__4__this._DataDownloaded_k__BackingField = val_20;
                label_17:
                this.<>m__Finally1();
                this._www_5__2 = 0;
                return false;
            }
            private void <>m__Finally1()
            {
                var val_2;
                this.__1__state = 0;
                if(this._www_5__2 == null)
                {
                        return;
                }
                
                val_2 = this._www_5__2;
            }
            private object System.Collections.Generic.IEnumerator<System.Object>.get_Current()
            {
                return (object)this.__2__current;
            }
            private void System.Collections.IEnumerator.Reset()
            {
                27351792 = new System.NotSupportedException();
                throw 27351792;
            }
            private object System.Collections.IEnumerator.get_Current()
            {
                return (object)this.__2__current;
            }
        
        }
        
        #endregion
        
        
        #region Crosstales.OnlineCheck.OnlineCheck.<google204Check>d__140
        // [Assembly-CSharp-firstpass.dll].Crosstales.OnlineCheck.OnlineCheck.<google204Check>d__140
        private sealed class _google204Check_d__140 : IEnumerator<object>, IEnumerator, IDisposable
        {
            // Fields
            private int __1__state;
            private object __2__current;
            public Crosstales.OnlineCheck.OnlineCheck __4__this;
            public bool showError;
            private string _url_5__2;
            private UnityEngine.Networking.UnityWebRequest _www_5__3;
            private float _startTime_5__4;
            
            // Properties
            private object System.Collections.Generic.IEnumerator<System.Object>.Current { get; }
            private object System.Collections.IEnumerator.Current { get; }
            
            // Methods
            public _google204Check_d__140(int __1__state)
            {
                this.__1__state = __1__state;
            }
            private void System.IDisposable.Dispose()
            {
                if(this.__1__state != 1)
                {
                        if(this.__1__state != 3)
                {
                        return;
                }
                
                }
                
                this.<>m__Finally1();
            }
            private bool MoveNext()
            {
                object val_17;
                UnityEngine.Networking.UnityWebRequest val_18;
                Crosstales.OnlineCheck.OnlineCheck val_19;
                UnityEngine.Networking.UnityWebRequest val_20;
                var val_21;
                var val_22;
                val_17 = this;
                val_18 = 27536664;
                val_19 = this.__4__this;
                if(this.__1__state != 1)
                {
                        if(this.__1__state != 0)
                {
                        return false;
                }
                
                    this.__1__state = 0;
                    if(val_19 == null)
                {
                        throw new NullReferenceException();
                }
                
                    this.__4__this.available = false;
                    int val_1 = UnityEngine.Random.Range(minInclusive:  1, maxExclusive:  7);
                    mem[1152921504930430448] = System.String.Format(format:  -1610598139, arg0:  536888099);
                    val_20 = UnityEngine.Networking.UnityWebRequest.Head(uri:  Crosstales.OnlineCheck.OnlineCheck.URLAntiCacheRandomizer(url:  mem[1152921504930430448]));
                    mem[1152921504930430456] = val_20;
                    this.__1__state = 2;
                    val_18 = mem[1152921504930430456];
                    mem[1152921504930430464] = UnityEngine.Time.realtimeSinceStartup;
                    if(val_18 == 0)
                {
                        throw new NullReferenceException();
                }
                
                    mem[1152921504930430424] = val_18.SendWebRequest();
                    this.__1__state = 1;
                    return false;
                }
                
                val_18 = this._www_5__3;
                this.__1__state = 2;
                if(val_18 == null)
                {
                        throw new NullReferenceException();
                }
                
                val_20 = 0;
                val_17 = 27342664;
                if(val_18.result == 3)
                {
                    goto label_7;
                }
                
                val_18 = mem[1152921504930430456];
                if(val_18 == 0)
                {
                        throw new NullReferenceException();
                }
                
                val_20 = 0;
                if(val_18.result != 2)
                {
                    goto label_9;
                }
                
                label_7:
                val_21 = 536882899;
                if(mem[536883123] == 0)
                {
                        val_21 = 536882899;
                }
                
                var val_17 = mem[536883083] + 72;
                val_17 = mem[1152921504930430440] | val_17;
                if(val_17 == false)
                {
                    goto label_14;
                }
                
                val_18 = mem[1152921504930430456];
                if(val_18 == 0)
                {
                        throw new NullReferenceException();
                }
                
                val_17 = -1610607791(-1610607791) + val_18.error;
                UnityEngine.Debug.LogError(message:  val_17, context:  val_19);
                goto label_14;
                label_9:
                val_22 = 536882899;
                if(mem[536883123] == 0)
                {
                        val_22 = 536882899;
                }
                
                if((mem[536883083] + 72) != 0)
                {
                        long val_11 = mem[1152921504930430456].responseCode;
                    val_17 = System.String.Format(format:  -1610604107, arg0:  mem[1152921504930430448], arg1:  536888155);
                    val_20 = val_19;
                    UnityEngine.Debug.Log(message:  val_17, context:  val_20);
                }
                
                val_18 = mem[1152921504930430456];
                if(val_18 == 0)
                {
                        throw new NullReferenceException();
                }
                
                val_20 = 0;
                long val_13 = val_18.responseCode;
                if(val_19 == null)
                {
                        throw new NullReferenceException();
                }
                
                this.__4__this.available = (val_13 == 204) ? 1 : 0;
                if(val_13 == 204)
                {
                        float val_15 = UnityEngine.Time.realtimeSinceStartup;
                    val_15 = val_15 - mem[1152921504930430464];
                    val_15 = val_15 * 1000f;
                    this.__4__this._LastCheckRTTMilliseconds_k__BackingField = (val_15 == Infinityf) ? -2147483648 : ((int)val_15);
                }
                
                long val_18 = this.__4__this._DataDownloaded_k__BackingField;
                val_18 = val_18 + 279;
                this.__4__this._DataDownloaded_k__BackingField = val_18;
                label_14:
                this.<>m__Finally1();
                this._www_5__3 = 0;
                return false;
            }
            private void <>m__Finally1()
            {
                var val_2;
                this.__1__state = 0;
                if(this._www_5__3 == null)
                {
                        return;
                }
                
                val_2 = this._www_5__3;
            }
            private object System.Collections.Generic.IEnumerator<System.Object>.get_Current()
            {
                return (object)this.__2__current;
            }
            private void System.Collections.IEnumerator.Reset()
            {
                27351792 = new System.NotSupportedException();
                throw 27351792;
            }
            private object System.Collections.IEnumerator.get_Current()
            {
                return (object)this.__2__current;
            }
        
        }
        
        #endregion
        
        
        #region Crosstales.OnlineCheck.OnlineCheck.<googleBlankCheck>d__141
        // [Assembly-CSharp-firstpass.dll].Crosstales.OnlineCheck.OnlineCheck.<googleBlankCheck>d__141
        private sealed class _googleBlankCheck_d__141 : IEnumerator<object>, IEnumerator, IDisposable
        {
            // Fields
            private int __1__state;
            private object __2__current;
            public Crosstales.OnlineCheck.OnlineCheck __4__this;
            public bool showError;
            private UnityEngine.Networking.UnityWebRequest _www_5__2;
            private float _startTime_5__3;
            
            // Properties
            private object System.Collections.Generic.IEnumerator<System.Object>.Current { get; }
            private object System.Collections.IEnumerator.Current { get; }
            
            // Methods
            public _googleBlankCheck_d__141(int __1__state)
            {
                this.__1__state = __1__state;
            }
            private void System.IDisposable.Dispose()
            {
                if(this.__1__state != 1)
                {
                        if(this.__1__state != 3)
                {
                        return;
                }
                
                }
                
                this.<>m__Finally1();
            }
            private bool MoveNext()
            {
                UnityEngine.Networking.DownloadHandlerBuffer val_19;
                UnityEngine.Networking.UnityWebRequest val_20;
                Crosstales.OnlineCheck.OnlineCheck val_21;
                UnityEngine.Networking.UnityWebRequest val_22;
                var val_23;
                var val_24;
                Crosstales.OnlineCheck.OnlineCheck.Crosstales_OnlineCheck_OnlineCheck__googleBlankCheck_d__141 val_25;
                val_19 = this;
                val_20 = 27494608;
                val_21 = this.__4__this;
                if(this.__1__state != 1)
                {
                        if(this.__1__state != 0)
                {
                        return false;
                }
                
                    this.__1__state = 0;
                    if(val_21 == null)
                {
                        throw new NullReferenceException();
                }
                
                    this.__4__this.available = false;
                    val_22 = UnityEngine.Networking.UnityWebRequest.Get(uri:  Crosstales.OnlineCheck.OnlineCheck.URLAntiCacheRandomizer(url:  -1610598121));
                    mem[1152921504930430448] = val_22;
                    this.__1__state = 2;
                    val_20 = mem[1152921504930430448];
                    mem[1152921504930430456] = UnityEngine.Time.realtimeSinceStartup;
                    if(val_20 == 0)
                {
                        throw new NullReferenceException();
                }
                
                    val_22 = this.__4__this.timeout;
                    val_20.timeout = val_22;
                    val_21 = mem[1152921504930430448];
                    val_20 = 536885261;
                    val_19 = val_20;
                    if(val_20 == 0)
                {
                        throw new NullReferenceException();
                }
                
                    val_20 = val_19;
                    val_22 = 0;
                    val_20 = new UnityEngine.Networking.DownloadHandlerBuffer();
                    if(val_21 == 0)
                {
                        throw new NullReferenceException();
                }
                
                    val_22 = val_19;
                    val_21.downloadHandler = val_22;
                    val_20 = mem[1152921504930430448];
                    if(val_20 == 0)
                {
                        throw new NullReferenceException();
                }
                
                    mem[1152921504930430424] = val_20.SendWebRequest();
                    this.__1__state = 1;
                    return false;
                }
                
                val_20 = this._www_5__2;
                this.__1__state = 2;
                if(val_20 == null)
                {
                        throw new NullReferenceException();
                }
                
                val_22 = 0;
                if(val_20.result == 3)
                {
                    goto label_10;
                }
                
                val_20 = mem[1152921504930430448];
                if(val_20 == 0)
                {
                        throw new NullReferenceException();
                }
                
                val_22 = 0;
                if(val_20.result != 2)
                {
                    goto label_12;
                }
                
                label_10:
                val_23 = 536882899;
                if(mem[536883123] == 0)
                {
                        val_23 = 536882899;
                }
                
                var val_18 = mem[536883083] + 72;
                val_18 = mem[1152921504930430440] | val_18;
                if(val_18 == false)
                {
                    goto label_17;
                }
                
                val_20 = mem[1152921504930430448];
                if(val_20 == 0)
                {
                        throw new NullReferenceException();
                }
                
                val_19 = -1610607789(-1610607789) + val_20.error;
                UnityEngine.Debug.LogError(message:  val_19, context:  val_21);
                goto label_17;
                label_12:
                val_20 = mem[1152921504930430448];
                if(val_20 == 0)
                {
                        throw new NullReferenceException();
                }
                
                val_22 = 0;
                UnityEngine.Networking.DownloadHandler val_9 = val_20.downloadHandler;
                if(val_9 == null)
                {
                        throw new NullReferenceException();
                }
                
                val_22 = 0;
                val_24 = 536882899;
                if(mem[536883123] == 0)
                {
                        val_24 = 536882899;
                }
                
                if((mem[536883083] + 72) != 0)
                {
                        val_22 = val_21;
                    UnityEngine.Debug.Log(message:  -1610608663(-1610608663) + val_9.text, context:  val_22);
                }
                
                val_20 = mem[1152921504930430448];
                if(val_20 == 0)
                {
                        throw new NullReferenceException();
                }
                
                val_22 = 0;
                ulong val_12 = val_20.downloadedBytes;
                if(val_21 == null)
                {
                        throw new NullReferenceException();
                }
                
                this.__4__this.available = (val_12 == 0) ? 1 : 0;
                if(val_12 != 0)
                {
                        val_25 = this;
                }
                else
                {
                        float val_14 = UnityEngine.Time.realtimeSinceStartup;
                    val_25 = this;
                    val_14 = val_14 - mem[1152921504930430456];
                    val_14 = val_14 * 1000f;
                    this.__4__this._LastCheckRTTMilliseconds_k__BackingField = (val_14 == Infinityf) ? -2147483648 : ((int)val_14);
                }
                
                val_19 = this.__4__this._DataDownloaded_k__BackingField;
                long val_17 = val_19 + mem[1152921504930430448].downloadedBytes;
                val_17 = val_17 + 831;
                this.__4__this._DataDownloaded_k__BackingField = val_17;
                label_17:
                this.<>m__Finally1();
                this._www_5__2 = 0;
                return false;
            }
            private void <>m__Finally1()
            {
                var val_2;
                this.__1__state = 0;
                if(this._www_5__2 == null)
                {
                        return;
                }
                
                val_2 = this._www_5__2;
            }
            private object System.Collections.Generic.IEnumerator<System.Object>.get_Current()
            {
                return (object)this.__2__current;
            }
            private void System.Collections.IEnumerator.Reset()
            {
                27351792 = new System.NotSupportedException();
                throw 27351792;
            }
            private object System.Collections.IEnumerator.get_Current()
            {
                return (object)this.__2__current;
            }
        
        }
        
        #endregion
        
        
        #region Crosstales.OnlineCheck.OnlineCheck.<>c__DisplayClass143_0
        // [Assembly-CSharp-firstpass.dll].Crosstales.OnlineCheck.OnlineCheck.<>c__DisplayClass143_0
        private sealed class __c__DisplayClass143_0
        {
            // Fields
            public Crosstales.OnlineCheck.OnlineCheck __4__this;
            public string url;
            public string data;
            public bool equals;
            public string type;
            public int header;
            public bool showError;
            
            // Methods
            public __c__DisplayClass143_0()
            {
            
            }
            internal void <startWorker>b__0()
            {
                this.__4__this.threadCheck(_available:  this.__4__this.available, url:  this.url, data:  this.data, equals:  this.equals, type:  this.type, header:  this.header, showError:  this.showError);
            }
        
        }
        
        #endregion
        
        
        #region Crosstales.OnlineCheck.OnlineCheck.<startWorker>d__143
        // [Assembly-CSharp-firstpass.dll].Crosstales.OnlineCheck.OnlineCheck.<startWorker>d__143
        private sealed class _startWorker_d__143 : IEnumerator<object>, IEnumerator, IDisposable
        {
            // Fields
            private int __1__state;
            private object __2__current;
            public Crosstales.OnlineCheck.OnlineCheck __4__this;
            public string url;
            public string data;
            public bool equals;
            public string type;
            public int header;
            public bool showError;
            
            // Properties
            private object System.Collections.Generic.IEnumerator<System.Object>.Current { get; }
            private object System.Collections.IEnumerator.Current { get; }
            
            // Methods
            public _startWorker_d__143(int __1__state)
            {
                this.__1__state = __1__state;
            }
            private void System.IDisposable.Dispose()
            {
            
            }
            private bool MoveNext()
            {
                System.Threading.ThreadStart val_6;
                if(this.__1__state != 1)
                {
                        if(this.__1__state != 0)
                {
                        return false;
                }
                
                    this.__1__state = 0;
                    object val_1 = 536899501;
                    val_1 = new System.Object();
                    mem[536899517] = this.__4__this;
                    mem[536899525] = this.url;
                    mem[536899533] = this.data;
                    val_6 = val_1;
                    mem[536899541] = this.equals;
                    mem[536899549] = this.type;
                    mem[536899557] = this.header;
                    mem[536899561] = this.showError;
                    if(this.__4__this.worker != null)
                {
                        if(this.__4__this.worker.IsAlive == true)
                {
                        return false;
                }
                
                }
                
                    System.Threading.ThreadStart val_3 = 536894245;
                    val_6 = val_3;
                    val_3 = new System.Threading.ThreadStart(object:  val_1, method:  1610683055);
                    System.Threading.Thread val_4 = 536894207;
                    val_4 = new System.Threading.Thread(start:  val_6);
                    mem2[0] = val_4;
                    this.__4__this + 112.Start();
                }
                else
                {
                        this.__1__state = 0;
                    if(this.__4__this.worker.IsAlive == false)
                {
                        return false;
                }
                
                }
                
                this.__2__current = 0;
                this.__1__state = 1;
                return false;
            }
            private object System.Collections.Generic.IEnumerator<System.Object>.get_Current()
            {
                return (object)this.__2__current;
            }
            private void System.Collections.IEnumerator.Reset()
            {
                27351792 = new System.NotSupportedException();
                throw 27351792;
            }
            private object System.Collections.IEnumerator.get_Current()
            {
                return (object)this.__2__current;
            }
        
        }
        
        #endregion
        
        
        #region Crosstales.OnlineCheck.OnlineCheck.<internetCheck>d__144
        // [Assembly-CSharp-firstpass.dll].Crosstales.OnlineCheck.OnlineCheck.<internetCheck>d__144
        private sealed class _internetCheck_d__144 : IEnumerator<object>, IEnumerator, IDisposable
        {
            // Fields
            private int __1__state;
            private object __2__current;
            public Crosstales.OnlineCheck.OnlineCheck __4__this;
            
            // Properties
            private object System.Collections.Generic.IEnumerator<System.Object>.Current { get; }
            private object System.Collections.IEnumerator.Current { get; }
            
            // Methods
            public _internetCheck_d__144(int __1__state)
            {
                this.__1__state = __1__state;
            }
            private void System.IDisposable.Dispose()
            {
            
            }
            private bool MoveNext()
            {
                int val_63;
                var val_64;
                var val_67;
                val_63 = this;
                if(this.__1__state > 13)
                {
                    goto label_1;
                }
                
                var val_1 = 6505600 + ((20182818 + (this.__1__state) << 1) << 2);
                val_64 = 27342680;
                goto (6505600 + (20182818 + (this.__1__state) << 1) << 2);
                label_1:
                val_67 = 0;
                return true;
            }
            private object System.Collections.Generic.IEnumerator<System.Object>.get_Current()
            {
                return (object)this.__2__current;
            }
            private void System.Collections.IEnumerator.Reset()
            {
                27351792 = new System.NotSupportedException();
                throw 27351792;
            }
            private object System.Collections.IEnumerator.get_Current()
            {
                return (object)this.__2__current;
            }
        
        }
        
        #endregion
        
        // Fields
        private bool endlessMode;
        private int intervalMin;
        private int intervalMax;
        private int timeout;
        private bool forceWWW;
        private Crosstales.OnlineCheck.Data.CustomCheck customCheck;
        private bool microsoft;
        private bool google204;
        private bool googleBlank;
        private bool apple;
        private bool ubuntu;
        private bool runOnStart;
        private float delay;
        private bool isFirsttime;
        private bool lastInternetAvailable;
        private UnityEngine.NetworkReachability lastNetworkReachability;
        private bool isRunning;
        private float checkTime;
        private float checkTimeCounter;
        private float burstTime;
        private float burstTimeCounter;
        private bool available;
        private UnityEngine.NetworkReachability networkReachability;
        private float lastCheckTime;
        private const float burstIntervalMin = 2;
        private const float burstIntervalMax = 5;
        private const string microsoftUrl = "http://www.msftncsi.com/ncsi.txt";
        private const string appleUrl = "https://www.apple.com/library/test/success.html";
        private const string ubuntuUrl = "https://start.ubuntu.com/connectivity-check";
        private const string fallbackUrl = "https://crosstales.com/media/downloads/up.txt";
        private const int google204HeaderSize = 279;
        private const int googleBlankHeaderSize = 831;
        private const int microsoftHeaderSize = 170;
        private const int appleHeaderSize = 376;
        private const int ubuntuHeaderSize = 425;
        private const int fallbackHeaderSize = 349;
        private const string microsoftText = "Microsoft NCSI";
        private const string appleText = "<TITLE>Success</TITLE>";
        private const string ubuntuText = "<TITLE>Lorem Ipsum</TITLE>";
        private const string fallbackText = "crosstales rulez!";
        private const string windowsDesc = "Microsoft";
        private const string appleDesc = "Apple";
        private const string ubuntuDesc = "Ubuntu";
        private const string fallbackDesc = "Fallback (crosstales)";
        private const string customDesc = "custom URL";
        private const string testingDesc = "Testing the Internet availability with:";
        private const bool microsoftEquals = True;
        private const bool appleEquals = False;
        private const bool ubuntuEquals = False;
        private const bool fallbackEquals = True;
        private System.Threading.Thread worker;
        private bool existsCustomCheck;
        private bool _isInternetAvailable_k__BackingField;
        private System.DateTime _LastCheck_k__BackingField;
        private long _DataDownloaded_k__BackingField;
        private int _LastCheckRTTMilliseconds_k__BackingField;
        public Crosstales.OnlineCheck.StatusChangeEvent OnStatusChange;
        public UnityEngine.Events.UnityEvent onInternetoff;
        public UnityEngine.Events.UnityEvent oninterneton;
        private Crosstales.OnlineCheck.OnlineCheck.OnlineStatusChange OnOnlineStatusChange;
        private Crosstales.OnlineCheck.OnlineCheck.NetworkReachabilityChange OnNetworkReachabilityChange;
        private Crosstales.OnlineCheck.OnlineCheck.OnlineCheckComplete OnOnlineCheckComplete;
        
        // Properties
        public bool EndlessMode { get; set; }
        public int IntervalMin { get; set; }
        public int IntervalMax { get; set; }
        public int Timeout { get; set; }
        public bool ForceWWW { get; set; }
        public Crosstales.OnlineCheck.Data.CustomCheck CustomCheck { get; set; }
        public bool Google204 { get; set; }
        public bool GoogleBlank { get; set; }
        public bool Microsoft { get; set; }
        public bool Apple { get; set; }
        public bool Ubuntu { get; set; }
        public bool RunOnStart { get; set; }
        public float Delay { get; set; }
        public bool isInternetAvailable { get; set; }
        public UnityEngine.NetworkReachability NetworkReachability { get; }
        public string NetworkReachabilityShort { get; }
        public System.DateTime LastCheck { get; set; }
        public long DataDownloaded { get; set; }
        public bool isBusy { get; }
        public float LastCheckRTT { get; }
        public int LastCheckRTTMilliseconds { get; set; }
        
        // Methods
        public bool get_EndlessMode()
        {
            return (bool)this.endlessMode;
        }
        public void set_EndlessMode(bool value)
        {
            this.endlessMode = value;
            if(value == false)
            {
                    return;
            }
            
            this.checkTimeCounter = this.checkTime;
        }
        public int get_IntervalMin()
        {
            if(this.intervalMin <= this.intervalMax)
            {
                    return val_1;
            }
            
            int val_1 = this.intervalMax - 1;
            this.intervalMin = val_1;
            return val_1;
        }
        public void set_IntervalMin(int value)
        {
            var val_1 = (value < 59) ? value : 59;
            var val_2 = (val_1 > 3) ? (val_1) : 3;
            this.intervalMin = (val_2 < this.intervalMax) ? (val_2) : (this.intervalMax - 1);
        }
        public int get_IntervalMax()
        {
            int val_2 = this.intervalMax;
            if(val_2 >= this.intervalMin)
            {
                    return val_2;
            }
            
            val_2 = this.intervalMin + 1;
            this.intervalMax = val_2;
            return val_2;
        }
        public void set_IntervalMax(int value)
        {
            var val_1 = (value < 60) ? value : 60;
            var val_2 = (val_1 > 4) ? (val_1) : 4;
            this.intervalMax = (val_2 > this.intervalMin) ? (val_2) : (this.intervalMin + 1);
        }
        public int get_Timeout()
        {
            if(this.timeout < this.intervalMin)
            {
                    return val_1;
            }
            
            int val_1 = this.intervalMin - 1;
            this.timeout = val_1;
            return val_1;
        }
        public void set_Timeout(int value)
        {
            var val_1 = (value < 10) ? value : 10;
            var val_2 = (val_1 > 1) ? (val_1) : (0 + 1);
            this.timeout = (val_2 < this.intervalMin) ? (val_2) : (this.intervalMin - 1);
        }
        public bool get_ForceWWW()
        {
            if(Crosstales.Common.Util.BaseHelper.isWebPlatform == true)
            {
                    return (bool)(this.forceWWW == true) ? 1 : 0;
            }
            
            if(Crosstales.Common.Util.BaseHelper.isWSABasedPlatform != false)
            {
                    return (bool)(this.forceWWW == true) ? 1 : 0;
            }
            
            return (bool)(this.forceWWW == true) ? 1 : 0;
        }
        public void set_ForceWWW(bool value)
        {
            this.forceWWW = value;
        }
        public Crosstales.OnlineCheck.Data.CustomCheck get_CustomCheck()
        {
            return (Crosstales.OnlineCheck.Data.CustomCheck)this.customCheck;
        }
        public void set_CustomCheck(Crosstales.OnlineCheck.Data.CustomCheck value)
        {
            this.customCheck = value;
            mem[1152921504930430520] = UnityEngine.Object.op_Inequality(x:  value, y:  0);
        }
        public bool get_Google204()
        {
            return (bool)this.google204;
        }
        public void set_Google204(bool value)
        {
            this.google204 = value;
        }
        public bool get_GoogleBlank()
        {
            return (bool)this.googleBlank;
        }
        public void set_GoogleBlank(bool value)
        {
            this.googleBlank = value;
        }
        public bool get_Microsoft()
        {
            return (bool)this.microsoft;
        }
        public void set_Microsoft(bool value)
        {
            this.microsoft = value;
        }
        public bool get_Apple()
        {
            return (bool)this.apple;
        }
        public void set_Apple(bool value)
        {
            this.apple = value;
        }
        public bool get_Ubuntu()
        {
            return (bool)this.ubuntu;
        }
        public void set_Ubuntu(bool value)
        {
            this.ubuntu = value;
        }
        public bool get_RunOnStart()
        {
            return (bool)this.runOnStart;
        }
        public void set_RunOnStart(bool value)
        {
            this.runOnStart = value;
        }
        public float get_Delay()
        {
            return (float)this.delay;
        }
        public void set_Delay(float value)
        {
            this.delay = value;
        }
        public bool get_isInternetAvailable()
        {
            return (bool)this._isInternetAvailable_k__BackingField;
        }
        private void set_isInternetAvailable(bool value)
        {
            this._isInternetAvailable_k__BackingField = value;
        }
        public UnityEngine.NetworkReachability get_NetworkReachability()
        {
            return (UnityEngine.NetworkReachability)this.networkReachability;
        }
        public string get_NetworkReachabilityShort()
        {
            UnityEngine.NetworkReachability val_2 = this.networkReachability;
            val_2 = (val_2 == 1) ? 27493880 : ((val_2 == 2) ? 27506128 : 27509040);
            return (string)val_2;
        }
        public System.DateTime get_LastCheck()
        {
            return (System.DateTime)this._LastCheck_k__BackingField;
        }
        private void set_LastCheck(System.DateTime value)
        {
            this._LastCheck_k__BackingField = value;
        }
        public long get_DataDownloaded()
        {
            return (long)this._DataDownloaded_k__BackingField;
        }
        private void set_DataDownloaded(long value)
        {
            this._DataDownloaded_k__BackingField = value;
        }
        public bool get_isBusy()
        {
            return (bool)this.isRunning;
        }
        public float get_LastCheckRTT()
        {
            float val_1 = (float)this._LastCheckRTTMilliseconds_k__BackingField;
            val_1 = val_1 / 1000f;
            return (float)val_1;
        }
        public int get_LastCheckRTTMilliseconds()
        {
            return (int)this._LastCheckRTTMilliseconds_k__BackingField;
        }
        private void set_LastCheckRTTMilliseconds(int value)
        {
            this._LastCheckRTTMilliseconds_k__BackingField = value;
        }
        public void add_OnOnlineStatusChange(Crosstales.OnlineCheck.OnlineCheck.OnlineStatusChange value)
        {
            do
            {
                if((System.Delegate.Combine(a:  this.OnOnlineStatusChange, b:  value)) != null)
            {
                    if(null != 536899523)
            {
                goto label_2;
            }
            
            }
            
            }
            while(this.OnOnlineStatusChange != 1152921504930430576);
            
            return;
            label_2:
        }
        public void remove_OnOnlineStatusChange(Crosstales.OnlineCheck.OnlineCheck.OnlineStatusChange value)
        {
            do
            {
                if((System.Delegate.Remove(source:  this.OnOnlineStatusChange, value:  value)) != null)
            {
                    if(null != 536899523)
            {
                goto label_2;
            }
            
            }
            
            }
            while(this.OnOnlineStatusChange != 1152921504930430576);
            
            return;
            label_2:
        }
        public void add_OnNetworkReachabilityChange(Crosstales.OnlineCheck.OnlineCheck.NetworkReachabilityChange value)
        {
            do
            {
                if((System.Delegate.Combine(a:  this.OnNetworkReachabilityChange, b:  value)) != null)
            {
                    if(null != 536899515)
            {
                goto label_2;
            }
            
            }
            
            }
            while(this.OnNetworkReachabilityChange != 1152921504930430584);
            
            return;
            label_2:
        }
        public void remove_OnNetworkReachabilityChange(Crosstales.OnlineCheck.OnlineCheck.NetworkReachabilityChange value)
        {
            do
            {
                if((System.Delegate.Remove(source:  this.OnNetworkReachabilityChange, value:  value)) != null)
            {
                    if(null != 536899515)
            {
                goto label_2;
            }
            
            }
            
            }
            while(this.OnNetworkReachabilityChange != 1152921504930430584);
            
            return;
            label_2:
        }
        public void add_OnOnlineCheckComplete(Crosstales.OnlineCheck.OnlineCheck.OnlineCheckComplete value)
        {
            do
            {
                if((System.Delegate.Combine(a:  this.OnOnlineCheckComplete, b:  value)) != null)
            {
                    if(null != 536899519)
            {
                goto label_2;
            }
            
            }
            
            }
            while(this.OnOnlineCheckComplete != 1152921504930430592);
            
            return;
            label_2:
        }
        public void remove_OnOnlineCheckComplete(Crosstales.OnlineCheck.OnlineCheck.OnlineCheckComplete value)
        {
            do
            {
                if((System.Delegate.Remove(source:  this.OnOnlineCheckComplete, value:  value)) != null)
            {
                    if(null != 536899519)
            {
                goto label_2;
            }
            
            }
            
            }
            while(this.OnOnlineCheckComplete != 1152921504930430592);
            
            return;
            label_2:
        }
        protected override void Awake()
        {
            Crosstales.OnlineCheck.Data.CustomCheck val_16;
            int val_17;
            this.Awake();
            val_16 = this.customCheck;
            this.existsCustomCheck = UnityEngine.Object.op_Inequality(x:  val_16, y:  0);
            this._isInternetAvailable_k__BackingField = (UnityEngine.Application.internetReachability != 0) ? 1 : 0;
            UnityEngine.NetworkReachability val_5 = UnityEngine.Application.internetReachability;
            this.lastNetworkReachability = val_5;
            this.networkReachability = val_5;
            if(this.existsCustomCheck == false)
            {
                    return;
            }
            
            if(Crosstales.Common.Util.BaseHelper.isEditor == true)
            {
                    return;
            }
            
            if((System.String.IsNullOrEmpty(value:  this.customCheck.url)) == true)
            {
                    return;
            }
            
            if((this.customCheck.url.Contains(value:  -1610599519)) != true)
            {
                    if((this.customCheck.url.Contains(value:  -1610610747)) == false)
            {
                    return;
            }
            
            }
            
            val_16 = -1610611993(-1610611993) + System.Environment.NewLine + -1610604467(-1610604467);
            UnityEngine.Debug.LogWarning(message:  val_16, context:  this);
            val_17 = this.intervalMin;
            int val_15 = this.intervalMax;
            if(val_17 > val_15)
            {
                    val_17 = val_15 - 1;
                this.intervalMin = val_17;
            }
            
            if(val_17 < 30)
            {
                    val_17 = 30;
            }
            else
            {
                    if(val_17 > 58)
            {
                    val_17 = 59;
            }
            
            }
            
            int val_13 = (59 < val_15) ? 59 : (val_15 - 1);
            val_15 = val_13 + 1;
            this.intervalMin = val_13;
            if(val_15 < val_13)
            {
                    this.intervalMax = val_15;
            }
            
            this.intervalMax = (val_13 < 60) ? 60 : (val_15);
        }
        private void Start()
        {
            if(this.runOnStart != true)
            {
                    if(Crosstales.Common.Util.BaseHelper.isEditorMode == false)
            {
                    return;
            }
            
            }
            
            if(this.isRunning != false)
            {
                    return;
            }
            
            this.Invoke(methodName:  -1610596423, time:  this.delay);
        }
        private void Update()
        {
            var val_14;
            float val_15;
            float val_16;
            var val_17;
            var val_18;
            var val_19;
            val_14 = 27342680;
            if(((this.existsCustomCheck != false) && (Crosstales.Common.Util.BaseHelper.isEditor != true)) && ((System.String.IsNullOrEmpty(value:  this.customCheck.url)) != true))
            {
                    if((this.customCheck.url.Contains(value:  -1610599519)) != true)
            {
                    if((this.customCheck.url.Contains(value:  -1610610747)) == false)
            {
                goto label_11;
            }
            
            }
            
                int val_14 = this.intervalMax;
                val_14 = (val_14 > 59) ? 59 : (val_14 - 1);
                this.intervalMin = val_14;
                this.intervalMax = (val_14 < 60) ? 60 : (val_14 + 1);
            }
            
            label_11:
            if(Crosstales.Common.Util.BaseHelper.isEditorMode != true)
            {
                    val_14 = 27344112;
                val_15 = mem[mem[536884463] + 4];
                val_15 = mem[536884463] + 4;
                val_16 = val_15 + UnityEngine.Time.deltaTime;
                mem2[0] = val_16;
                if(this._isInternetAvailable_k__BackingField != false)
            {
                    val_15 = mem[mem[536884463] + 8];
                val_15 = mem[536884463] + 8;
                val_16 = val_15 + UnityEngine.Time.deltaTime;
                mem2[0] = val_16;
            }
            
            }
            
            if(this.endlessMode == false)
            {
                    return;
            }
            
            if(this.isRunning != false)
            {
                    return;
            }
            
            val_17 = 27345240;
            float val_10 = UnityEngine.Time.deltaTime;
            val_10 = this.checkTimeCounter + val_10;
            this.checkTimeCounter = val_10;
            float val_11 = UnityEngine.Time.deltaTime;
            val_11 = this.burstTimeCounter + val_11;
            this.burstTimeCounter = val_11;
            if(this._isInternetAvailable_k__BackingField == false)
            {
                goto label_17;
            }
            
            if(this.checkTimeCounter < this.checkTime)
            {
                    return;
            }
            
            val_18 = 536882899;
            if(mem[536883123] == 0)
            {
                    val_18 = 536882899;
            }
            
            if((mem[536883083] + 72) == 0)
            {
                goto label_24;
            }
            
            val_17 = 27509064;
            if(mem[536885163] != 0)
            {
                goto label_25;
            }
            
            label_26:
            label_25:
            UnityEngine.Debug.Log(message:  -1610605045, context:  this);
            label_24:
            this.checkTimeCounter = 0f;
            this.burstTimeCounter = 0f;
            UnityEngine.Coroutine val_13 = this.StartCoroutine(routine:  this.internetCheck());
            return;
            label_17:
            if(val_11 < this.burstTime)
            {
                    return;
            }
            
            val_19 = 536882899;
            if(mem[536883123] == 0)
            {
                    val_19 = 536882899;
            }
            
            if((mem[536883083] + 72) == 0)
            {
                goto label_24;
            }
            
            if(mem[536885163] != 0)
            {
                goto label_25;
            }
            
            goto label_26;
        }
        protected override void OnApplicationQuit()
        {
            var val_2;
            if((this.worker != null) && (this.worker.IsAlive != false))
            {
                    val_2 = 536882899;
                if(mem[536883123] == 0)
            {
                    val_2 = 536882899;
            }
            
                if((mem[536883083] + 72) != 0)
            {
                    UnityEngine.Debug.Log(message:  -1610605803, context:  this);
            }
            
                this.worker.Abort();
            }
            
            this.OnApplicationQuit();
        }
        private void OnValidate()
        {
            int val_2;
            int val_3;
            if(this.delay < 0)
            {
                    this.delay = 0f;
            }
            
            val_2 = this.intervalMin;
            if(val_2 >= 3)
            {
                goto label_1;
            }
            
            val_2 = 3;
            goto label_2;
            label_1:
            if(val_2 < 60)
            {
                goto label_3;
            }
            
            val_2 = 59;
            label_2:
            this.intervalMin = 59;
            label_3:
            val_3 = this.intervalMax;
            if(val_3 >= 4)
            {
                goto label_4;
            }
            
            val_3 = 4;
            goto label_5;
            label_4:
            if(val_3 < 61)
            {
                goto label_6;
            }
            
            val_3 = 60;
            label_5:
            this.intervalMax = 60;
            label_6:
            if(59 <= this.timeout)
            {
                    val_2 = this.timeout + 1;
                this.intervalMin = val_2;
            }
            
            if(val_2 < 60)
            {
                    return;
            }
            
            val_2 = val_2 + 1;
            this.intervalMax = val_2;
        }
        public static void ResetObject()
        {
            Crosstales.Common.Util.Singleton<System.Object>.DeleteInstance();
        }
        public void Refresh(bool triggerCallbacks = False)
        {
            if(this != 0)
            {
                    if(this.isActiveAndEnabled == false)
            {
                    return;
            }
            
            }
            
            if(this.isRunning == true)
            {
                    return;
            }
            
            float val_3 = UnityEngine.Time.realtimeSinceStartup;
            float val_7 = 1f;
            val_7 = this.lastCheckTime + val_7;
            if(val_7 >= 0)
            {
                    return;
            }
            
            bool val_8 = this.isFirsttime;
            val_8 = val_8 | triggerCallbacks;
            this.isFirsttime = val_8;
            UnityEngine.Coroutine val_6 = this.StartCoroutine(routine:  this.internetCheck());
        }
        public System.Collections.IEnumerator RefreshYield(bool triggerCallbacks = False)
        {
            Crosstales.OnlineCheck.OnlineCheck.Crosstales_OnlineCheck_OnlineCheck__RefreshYield_d__137 val_2 = 536899503;
            val_2 = new Crosstales.OnlineCheck.OnlineCheck.Crosstales_OnlineCheck_OnlineCheck__RefreshYield_d__137(__1__state:  0);
            mem[536899535] = this;
            mem[536899543] = triggerCallbacks;
            return (System.Collections.IEnumerator)val_2;
        }
        private void run()
        {
            UnityEngine.Coroutine val_2 = this.StartCoroutine(routine:  this.internetCheck());
        }
        private System.Collections.IEnumerator wwwCheck(string url, string data, bool equals, string type, int header, bool showError = False)
        {
            Crosstales.OnlineCheck.OnlineCheck.Crosstales_OnlineCheck_OnlineCheck__wwwCheck_d__139 val_3 = 536899513;
            val_3 = new Crosstales.OnlineCheck.OnlineCheck.Crosstales_OnlineCheck_OnlineCheck__wwwCheck_d__139(__1__state:  0);
            mem[536899545] = this;
            mem[536899553] = url;
            mem[536899569] = data;
            mem[536899561] = equals;
            mem[536899585] = type;
            mem[536899577] = header;
            mem[536899581] = showError;
            return (System.Collections.IEnumerator)val_3;
        }
        private System.Collections.IEnumerator google204Check(bool showError = False)
        {
            Crosstales.OnlineCheck.OnlineCheck.Crosstales_OnlineCheck_OnlineCheck__google204Check_d__140 val_2 = 536899505;
            val_2 = new Crosstales.OnlineCheck.OnlineCheck.Crosstales_OnlineCheck_OnlineCheck__google204Check_d__140(__1__state:  0);
            mem[536899537] = this;
            mem[536899545] = showError;
            return (System.Collections.IEnumerator)val_2;
        }
        private System.Collections.IEnumerator googleBlankCheck(bool showError = False)
        {
            Crosstales.OnlineCheck.OnlineCheck.Crosstales_OnlineCheck_OnlineCheck__googleBlankCheck_d__141 val_2 = 536899507;
            val_2 = new Crosstales.OnlineCheck.OnlineCheck.Crosstales_OnlineCheck_OnlineCheck__googleBlankCheck_d__141(__1__state:  0);
            mem[536899539] = this;
            mem[536899547] = showError;
            return (System.Collections.IEnumerator)val_2;
        }
        private void threadCheck([Out] bool _available, string url, string data, bool equals, string type, int header, bool showError = False)
        {
            var val_15;
            string val_16;
            string val_17;
            var val_18;
            string val_19;
            var val_20;
            var val_21;
            var val_23;
            var val_24;
            val_15 = 27343312;
            val_16 = data;
            val_17 = url;
            mem2[0] = 0;
            if(536883419 == 0)
            {
                    throw new NullReferenceException();
            }
            
            536883419 = new Crosstales.OnlineCheck.Util.CTWebClientNotCached(timeout:  this.timeout * 1000, connectionLimit:  20);
            val_15 = 27348040;
            System.Diagnostics.Stopwatch val_3 = System.Diagnostics.Stopwatch.StartNew();
            val_17 = 536883419.DownloadString(address:  val_17);
            val_18 = 536882899;
            if(mem[536883123] == 0)
            {
                    val_18 = 536882899;
            }
            
            if((mem[536883083] + 72) != 0)
            {
                    UnityEngine.Debug.Log(message:  -1610608665(-1610608665) + type + -1610610373(-1610610373) + val_17, context:  this);
            }
            
            if(equals == false)
            {
                goto label_6;
            }
            
            val_19 = 0;
            if(((System.String.IsNullOrEmpty(value:  val_17)) == true) || (val_17 == null))
            {
                goto label_13;
            }
            
            val_20 = val_17;
            val_19 = val_16;
            bool val_7 = val_20.Equals(value:  val_19, comparisonType:  5);
            goto label_14;
            label_6:
            val_19 = 0;
            if(((System.String.IsNullOrEmpty(value:  val_17)) == true) || (val_17 == null))
            {
                goto label_13;
            }
            
            val_19 = val_16;
            val_20 = (~(val_17.IndexOf(value:  val_19, comparisonType:  5))) >> 31;
            goto label_14;
            label_13:
            val_20 = 0;
            label_14:
            mem2[0] = val_20 & 1;
            if(this.available != false)
            {
                    if(val_3 == null)
            {
                    throw new NullReferenceException();
            }
            
                this._LastCheckRTTMilliseconds_k__BackingField = val_3.ElapsedMilliseconds;
            }
            
            val_20 = val_3;
            val_19 = 0;
            val_20.Stop();
            if(val_17 == null)
            {
                    throw new NullReferenceException();
            }
            
            int val_14 = val_4._stringLength;
            val_16 = 0;
            val_14 = val_14 + header;
            val_14 = this._DataDownloaded_k__BackingField + (val_14 << );
            this._DataDownloaded_k__BackingField = val_14;
            var val_17 = mem[536883419];
            var val_16 = mem[536883419] + 298;
            if(val_16 == 0)
            {
                goto label_20;
            }
            
            var val_15 = mem[536883419] + 176;
            val_15 = val_15 + 8;
            label_22:
            if(((mem[536883419] + 176 + 8) + -8) == 536887297)
            {
                goto label_21;
            }
            
            val_16 = val_16 - 1;
            val_15 = val_15 + 16;
            if(((mem[536883419] + 176 + 8) + -8) != 536887297)
            {
                goto label_22;
            }
            
            label_20:
            val_21 = 536883419;
            goto label_23;
            label_21:
            val_17 = val_17 + (((mem[536883419] + 176 + 8)) << 4);
            val_21 = val_17 + 312;
            label_23:
            val_19 = mem[((mem[536883419] + ((mem[536883419] + 176 + 8)) << 4) + 312) + 8];
            val_19 = ((mem[536883419] + ((mem[536883419] + 176 + 8)) << 4) + 312) + 8;
            if(val_16 == 0)
            {
                    return;
            }
            
            val_20 = val_16;
            throw new NullReferenceException();
            label_45:
            var val_20 = mem[536883419];
            var val_19 = mem[536883419] + 298;
            if(val_19 == 0)
            {
                goto label_40;
            }
            
            var val_18 = mem[536883419] + 176;
            val_18 = val_18 + 8;
            label_42:
            if(((mem[536883419] + 176 + 8) + -8) == val_15)
            {
                goto label_41;
            }
            
            val_19 = val_19 - 1;
            val_18 = val_18 + 16;
            if(((mem[536883419] + 176 + 8) + -8) != val_15)
            {
                goto label_42;
            }
            
            label_40:
            val_24 = 536883419;
            goto label_43;
            label_41:
            val_20 = val_20 + (((mem[536883419] + 176 + 8)) << 4);
            val_24 = val_20 + 312;
            label_43:
            if(0 == 0)
            {
                goto label_44;
            }
            
            goto label_45;
            label_44:
            if( == 1)
            {
                    if((27346264 & 1) != 0)
            {
                    bool val_21 = mem[536883121];
                val_21 = val_21 | showError;
                if(val_21 == false)
            {
                    return;
            }
            
                UnityEngine.Debug.LogError(message:  System.String.Format(format:  27498112, arg0:  type, arg1:  1179403647), context:  this);
                return;
            }
            
                mem[8] = 1179403647;
                val_23 = 8;
            }
        
        }
        private System.Collections.IEnumerator startWorker(string url, string data, bool equals, string type, int header, bool showError = False)
        {
            Crosstales.OnlineCheck.OnlineCheck.Crosstales_OnlineCheck_OnlineCheck__startWorker_d__143 val_3 = 536899511;
            val_3 = new Crosstales.OnlineCheck.OnlineCheck.Crosstales_OnlineCheck_OnlineCheck__startWorker_d__143(__1__state:  0);
            mem[536899543] = this;
            mem[536899551] = url;
            mem[536899559] = data;
            mem[536899567] = equals;
            mem[536899575] = type;
            mem[536899583] = header;
            mem[536899587] = showError;
            return (System.Collections.IEnumerator)val_3;
        }
        private System.Collections.IEnumerator internetCheck()
        {
            Crosstales.OnlineCheck.OnlineCheck.Crosstales_OnlineCheck_OnlineCheck__internetCheck_d__144 val_1 = 536899509;
            val_1 = new Crosstales.OnlineCheck.OnlineCheck.Crosstales_OnlineCheck_OnlineCheck__internetCheck_d__144(__1__state:  0);
            mem[536899541] = this;
            return (System.Collections.IEnumerator)val_1;
        }
        private static string URLAntiCacheRandomizer(string url)
        {
            int val_1 = UnityEngine.Random.Range(minInclusive:  1, maxExclusive:  -2147483648);
            return (string)System.String.Format(format:  -1610594665, arg0:  url, arg1:  536888099);
        }
        private void onInternetStatusChange(bool isConnected)
        {
            if(mem[536884349] == 0)
            {
                    536884125 = 536884125;
            }
            
            if(mem[536884309] != 0)
            {
                    bool val_1 = isConnected;
                UnityEngine.Debug.Log(message:  System.String.Format(format:  -1610596841, arg0:  536883173), context:  this);
            }
            
            if((Crosstales.Common.Util.BaseHelper.isEditorMode != true) && (this.OnStatusChange != null))
            {
                    this.OnStatusChange.Invoke(arg0:  isConnected);
            }
            
            if(this.OnOnlineStatusChange != null)
            {
                    bool val_5 = isConnected;
            }
            
            if(isConnected != false)
            {
                    this.oninterneton.Invoke();
                UnityEngine.GameObject val_8 = this.transform.GetChild(index:  0).gameObject;
            }
            else
            {
                    this.onInternetoff.Invoke();
            }
            
            this.transform.GetChild(index:  0).gameObject.SetActive(value:  true);
        }
        private void onNetworkReachabilityChange(UnityEngine.NetworkReachability _networkReachability)
        {
            if(mem[536884349] == 0)
            {
                    536884125 = 536884125;
            }
            
            if(mem[536884309] != 0)
            {
                    UnityEngine.Debug.Log(message:  System.String.Format(format:  -1610596839, arg0:  536890043), context:  this);
            }
            
            if(this.OnNetworkReachabilityChange == null)
            {
                    return;
            }
        
        }
        private void onInternetCheckComplete(bool isConnected, UnityEngine.NetworkReachability _networkReachability)
        {
            object val_5;
            var val_6;
            val_5 = 27343944;
            System.DateTime val_1 = System.DateTime.Now;
            this._LastCheck_k__BackingField = val_1;
            val_6 = 536884125;
            if(mem[536884349] == 0)
            {
                    val_6 = 536884125;
            }
            
            if(mem[536884309] != 0)
            {
                    bool val_2 = isConnected;
                val_5 = System.String.Format(format:  -1610596843, arg0:  536883173, arg1:  536890043);
                UnityEngine.Debug.Log(message:  val_5, context:  this);
            }
            
            if(this.OnOnlineCheckComplete == null)
            {
                    return;
            }
            
            bool val_4 = isConnected;
        }
        public OnlineCheck()
        {
            this.timeout = 2;
            this.endlessMode = true;
            this.isFirsttime = true;
            this.ubuntu = true;
            this.runOnStart = true;
            this.microsoft = true;
            this.google204 = true;
            this.googleBlank = true;
            this.apple = true;
            this.checkTime = 9999f;
            this.burstTime = 9999f;
            this.intervalMin = 8;
            this.intervalMax = 12;
            this.lastCheckTime = 1.175494E-38f;
            if(mem[536878697] != 0)
            {
                    return;
            }
        
        }
    
    }

}
